package dog_mall_login.service_impl;

import dog_mall_commons.dao.DogsMapper;
import dog_mall_commons.dao.UsersMapper;
import dog_mall_commons.pojo.Dogs;
import dog_mall_commons.pojo.Users;
import dog_mall_login.service.DoLogin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DoLoginImpl implements DoLogin {
    @Autowired
    private UsersMapper usersMapper;

    @Autowired
    private DogsMapper dogsMapper;

    @Override
    public Users DoLogin(Users users) {

        return usersMapper.selectByUsernameAndPassword(users);
    }

    @Override
    public List<Dogs> findAllDogs(Integer userId) {
        return dogsMapper.selectAllByUserId(userId);
    }
}
